#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
#  Objekts.py
#
#  Copyright 2011 Arne Hüffmeier <ahueffme@gmail.com>
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#  MA 02110-1301, USA.
#
#


class Episode(object):
	def __init__(self, serie, season, epi, gName=None, gDate=None, eName=None,
		eDate=None):
		self.serie = serie
		self._season = season
		self._episode = epi
		self._germanName = gName
		self._germanDate = gDate
		self._englishName = eName
		self._englishDate = eDate

	def __del__(self):
		pass

	def EnglishName(self):
		pass

	def GermanDataName(self):
		print("o", self._episode, "-", self._germanName)
		#return self._episode+"-"+self._germanName

	def printshort(self):
		out = "" + str(self._season) + " " + str(self._episode)
		if self._germanName is not None:
			out += " " + self._germanName
		else:
			out += " " + self._englishName
		print(out)

	def filename(self):
		out = self.serie + " S" + str(self._season).zfill(2) + "E" +\
		str(self._episode).zfill(2) + " - "
		if self._germanName is not None:
			out += self._germanName
		else:
			out += self._englishName
		return out

	def printall(self):
		out = ""
		if self._episode is not None:
			out += self._episode
		if self._germanName is not None:
			out += (" " + self._germanName)
		if self._germanDate is not None:
			out += (" " + self._germanDate)
		if self._englishName is not None:
			out += (", " + self._englishName)
		if self._englishDate is not None:
			out += (" " + self._englishDate + "\n")
		print(out)


class Serie(object):

	def __init__(self, name, serienId, overview, firstAired):
		self.name = name
		self.serienId = serienId
		self.overview = overview
		self.firstAired = firstAired

	def printAll(self):
		print(self.name, self.serienId)
